<template>
	<view class="gui-padding gui-margin-top">
		<view class="gui-flex gui-rows gui-nowrap gui-align-items-center">
			<text class="gui-primary-color gui-h6 gui-flex1 gui-bold">可约时段</text>
		</view>

		<gui-column :customClasses="['gui-margin-top', 'gui-bg-gray']" crossAxisAlignment="center">
			<text class=" demo gui-bg-gray gui-color-black gui-bold">周末</text>
			<span class="gui-text-small demo gui-bg-gray gui-color-black gui-grids-icon gui-icons gui-text-left" @tap="goto_scheduing_details('weekend')" style="width: 750rpx;min-height: 50rpx;height: auto;"> {{weekend_time}} &#xe601;</span>
			<text class=" demo gui-bg-gray gui-color-black gui-bol gui-margin-top-large gui-bold">工作日</text>
			<span class="gui-text-small demo gui-bg-gray gui-color-black gui-grids-icon gui-icons gui-text-left" @tap="goto_scheduing_details('weekday')" style="width: 750rpx;min-height: 50rpx;height: auto;"> {{weekday_time}} &#xe601;</span>
		</gui-column>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				weekday_time:'08:00~21:00',
				weekend_time:'08:00~21:00',
			}
		},
		onLoad:function(query){
			this.$globalMethod();
			this.get_user_paiban_list();
		},
		methods:{
			get_user_paiban_list(){
				let _this = this;
				_this.graceJS.get(_this.serverUrl + '/api.teacher/get_user_paiban_list', {
						
					}, {
						token: _this.token
					}, (res) => {
						if (res.code == 0) {
							_this.weekday_time = res.data.weekday_list;
							_this.weekend_time = res.data.weekend_list;
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'error'
							})
						}
					},
					(e) => {
						uni.showToast({
							title: '网络请求错误，请稍后重试',
							icon: 'error'
						})
					})
			},
			goto_scheduing_details(tag){
				uni.navigateTo({
					url:'/pages/assistant/scheduling_details?tag='+tag
				})
			},
		}
	}
</script>

<style>
	.small-text {
		font-size: 22rpx;
	}

	.title1-margin {
		margin: 0 20rpx;
	}

	.demo {
		width: 210rpx;
		height: 68rpx;
		line-height: 68rpx;
		text-align: center;
		margin: 10rpx;
	}

	.demo-auto-width {
		height: 68rpx;
		line-height: 68rpx;
		text-align: center;
		margin: 10rpx;
	}

	.gui-text-small {
		font-size: 20rpx;
	}
</style>